from fastapi import FastAPI
from typing import List
from API.HelloWord import HelloWord
from API.Info import InfoTest
#from API.DataBase import
#region API模型
class APIModel():
    def __init__(self,obj:object,url:str,tags:List[str]):
        self.obj=obj
        self.url=url
        self.tags=tags
#endregion API模型结束

class Api():
#region 路由基础配置
    def __init__(self,api:FastAPI):
        self.api=api
    def useApi(self):
        for item in self.myapi:
             self.api.include_router(item.obj,prefix=item.url,tags=item.tags)
#endregion
#region API的路由设置
    myapi=[
        APIModel(HelloWord,'/Hello',['欢迎尝试接口，点击试试吧']),
        APIModel(InfoTest,'/Info',['软件信息']),
    ]
#endregion


